package com.pointmi.merchantservice;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.pointmi.merchantdao.Merchant;
import com.pointmi.merchantdao.MerchantDAO;

public class MerchantServiceImpl implements MerchantService {
	
	@Autowired
	@Qualifier("merchantDAO")
	MerchantDAO merchantDao;
	
	public void setMerchantDAO(MerchantDAO merchantDao)
	{
		this.merchantDao = merchantDao;
	}

	public void saveOrUpdate(Merchant merchant) 
	{
		merchantDao.saveOrUpdate(merchant);		
	}

	public Merchant findMerchantById(int merchantId) {
		
		return merchantDao.findMerchantById(merchantId);
	}
	public List<Merchant> findAllMerchant() {
		
		return merchantDao.findAllMerchant();
	}
}
